<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>">
<title>增加网页元素</title>
<link href="css/base.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/calendar/calendar.js"></script>
<script src="../include/js/jquery/jquery.js" language="javascript" type="text/javascript"></script>
<script lang='javascript' src='js/tb-box.js'></script>
<script language="javascript">
function checkSubmit()
{
	if(document.form1.title.value=="")
	{
		alert("标题不为能空！");
		document.form1.title.focus();
		return false;
	}
}

function postip($this){
	var text = $this.find('option:selected').attr('tabname');
	$('#postip').html(text);
}
</script>
<style type="text/css">
.typetab {
	text-align: left;
}
.typetab ul {
	list-style: none;
}
.typetab ul li {
	float: left;
	margin: 5px 5px 0px;
	height: 23px;
	width: 64px;
	background: url(images/adtype_link.gif) no-repeat scroll 0px 0px;
	line-height: 23px;
	text-align: center;
	cursor: pointer;
}
.typetab ul .act {
	background: url(images/adtype_act.gif) no-repeat scroll 0px 0px;
}
.i_table {
	border: 1px solid #CCC;
}
</style>
</head>
<body background="images/allbg.gif" leftmargin='8' topmargin='8'>
<form action="web_add.php" method="post" name="form1" enctype="multipart/form-data" onSubmit="return checkSubmit()">
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6">
  <tr>
    <td height="28" background="images/tbg.gif" style="padding-left:10px;"><b><a href="web_main.php"><u>网页元素管理</u></a></b> &gt;&gt; 增加网页元素 </td>
  </tr>
  <tr>
    <td height="200" bgcolor="#FFFFFF" valign="top"><table width="100%" border="0" cellspacing="4" cellpadding="4">
 
          <input type='hidden' name='dopost' value='save'>
           <tr>
            <td height="25" align="center">栏目：</td>
            <td colspan="2">
              <?php
              $typeOptions = GetOptionList($cid,$cuserLogin->getUserChannel(),$channelid);
              echo "<select name='arctype_id' id='arctype_id' style='width:240px'>\r\n";
              echo "<option value='0'>请选择栏目...</option>\r\n";
              echo $typeOptions;
              echo "</select>";
          ?></td>
          </tr>
          <tr>
            <td height="25" align="center">位置：</td>
            <td colspan="2"><select name='position' style='width:200px;' id="position" onchange="postip($(this))">
                <option value='0' tabtitle="">请选择...</option>
                <?php echo inc_web::position_option();?>
              </select>
              <br />
              <div style="color:#333333; line-height:25px; color:#FF0000;" id="postip"></div>
              </td>
          </tr>
          <tr>
            <td height="25" align="center">标题：</td>
            <td colspan="2"><input name="title" type="text" id="tagname" class='iptxt' style='width:400px;'/>
              </td>
          </tr>
          <tr>
            <td height="25" align="center">说明：</td>
            <td colspan="2"><textarea class="input" name="remark" id="remark" style="width:400px; height:100px;"></textarea></td>
          </tr>
            <tr>
            <td height="25" align="center">链接：</td>
            <td colspan="2"><input name="link" type="text" id="tagname" class='iptxt' style='width:340px'/></td>
          </tr>
		  <tr>
          <td height="25" align="center">大图片：</td>
          <td colspan="2"><input name="big_img" type="file" id="big_img" style="width:240px" size="50"/>
          </td>
          </tr>
          <tr>
          <td height="25" align="center">小图片：</td>
          <td colspan="2"><input name="small_img" type="file" id="big_img" style="width:240px" size="50"/>
          </tr>
          <tr>
            <td height="25" align="center">序号：</td>
            <td colspan="2"><input name="sort" type="text" id="sort" size="10" class='iptxt' /></td>
          </tr>
          <tr>
            <td height="53" align="center">&nbsp;</td>
            <td colspan="2"><input name="imageField" type="image" src="images/button_ok.gif" width="60" height="22" border="0" class="np" /></td>
          </tr>
        
      </table></td>
  </tr>
</table>
</form>
<script language="JavaScript">
(function($){
	function showcode(idName){
		$("#advert").html("").html($("#formtxt>#"+idName).html());
		$("#adstyle").val(idName);
	}
	
	showcode('code');

	$("#changeTab>li").click(function()
	{
		var tabLi = $(this);
		var thistab = tabLi[0].id;
		$(".content").each(function()
		{
			if("t_" + $(this)[0].id == thistab)
			{ 
			    $("#changeTab>li").removeClass("act");
			    $("#t_" + $(this)[0].id).addClass("act");
			    showcode($(this)[0].id);
			}
		})
	})
})(jQuery);
</script>
</body>
</html>